<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8" isELIgnored="false"%>
<%@ taglib uri="http://java.sun.com/jstl/core_rt" prefix="c"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head lang="en">
<meta charset="utf-8" />
<title>order</title>
<link rel="stylesheet" type="text/css" href="o/css/public2.css" />
<link rel="stylesheet" type="text/css" href="o/css/proList.css" />
<link rel="stylesheet" type="text/css" href="o/css/mygxin.css" />
<script language="JavaScript">


function deleteAddress(address_id,c_id) {
	var Oid = ${Oid};
// 	alert("Oid:"+Oid);
// 	alert("add:"+address_id);
// 	alert("cid:"+c_id);
	if (confirm("是否删除地址？")) {
		alert("地址"+address_id+"删除成功！");
		window.location.href="deleteAddress.do?address_id="+address_id+"&c_id="+c_id+"&Oid="+Oid;
	} else {
		alert("删除失败！");
	}
}

function select(id) {
	 var address_id = id;
     document.getElementById('show').value=address_id;
}

function checkout() {
	var Oid = ${Oid};
	var address_id = $("#show").val();
// 	alert(address_id);
	if(address_id==""||address_id==null){
		alert("请先选择地址!");
	}
	else{
	window.location.href="editOrder.do?address_id="+address_id+"&Oid="+Oid;
	}
}

function message(Oid) {
	window.location.href="turnMessage.do?Oid="+Oid;
}

</script>
</head>
<body>
	<!----------------------------------------order------------------>
	<div class="head ding">
		<div class="wrapper clearfix">
			<div class="clearfix" id="top">
				<h1 class="fl">
					<a href="home.jsp?c_id=${sessionScope.custom.c_id}"><img
						src="o/images/logo.png" /></a>
				</h1>
				<div class="fr clearfix" id="top1">
					<p class="fl">
						<a href="" id="login">登录</a> <a href="" id="reg">注册</a>
					</p>
					
					<div class="btn fl clearfix">
						<a href=""><img src="o/img/grzx.png" /></a> <a href="" class="er1"><img
							src="o/img/ewm.png" /></a> <a
							href="cart.do?c_id=${sessionScope.custom.c_id}"><img
							src="o/img/gwc.png" /></a>
						<p>
							<a href=""><img src="o/img/smewm.png" /></a>
						</p>
					</div>
				</div>
			</div>
			<ul class="clearfix" id="bott">
				<li><a href="menu/recommand.do">首页</a></li>
				<li><a href="">所有商品</a>
					<div class="sList">
						<div class="wrapper  clearfix">
							<a href="">
								<dl>
									<dt>
										<img src="o/img/中餐.jpg" />
									</dt>
									<dd>中餐</dd>
								</dl>
							</a> <a href="">
								<dl>
									<dt>
										<img src="o/img/西餐.jpg" />
									</dt>
									<dd>西餐</dd>
								</dl>
							</a> <a href="">
								<dl>
									<dt>
										<img src="o/img/快餐.jpg" />
									</dt>
									<dd>快餐</dd>
								</dl>
							</a> <a href="">
								<dl>
									<dt>
										<img src="o/img/点心.jpg" />
									</dt>
									<dd>点心</dd>
								</dl>
							</a> <a href="">
								<dl>
									<dt>
										<img src="o/img/饮品.jpg" />
									</dt>
									<dd>饮品</dd>
								</dl>
							</a>
						</div>
					</div></li>
				
			</ul>
		</div>
	</div>
	<div class="order cart mt">
		<!-----------------site------------------->
		<div class="site">
			<p class="wrapper clearfix">
				<span class="fl">订单确认</span> <img class="top"
					src="o/img/temp/cartTop02.png">
			</p>
		</div>
		<!-----------------orderCon------------------->
		<div class="orderCon wrapper clearfix">
			<div class="orderL fl">
				<!--------h3---------------->
				<h3>
					收件信息&nbsp&nbsp&nbsp&nbsp<a href="turnAdd.do?Oid=${Oid}">新增地址</a>&nbsp&nbsp&nbsp&nbsp选择地址:<input type="text" id="show" placehoder="未选择地址" readonly="readonly">
				</h3>
				<!--------addres---------------->

				<div class="addres clearfix">
					<c:forEach items="${address}" var="exp3">
						<div class="addre fl on">
							<div class="tit clearfix">
								<p class="fl">${exp3.c_id}</p>
								<p class="fr">
									<a href="javascript:void(0);"
										onclick="deleteAddress(${exp3.address_id},${exp3.c_id})">删除</a>
									<span>|</span> <a
										href="turnEdit.do?Oid=${Oid}&address_id=${exp3.address_id}&address_name=${exp3.address_name}&address_detail=${exp3.address_detail}&address_phone=${exp3.address_phone}"
										class="edit">编辑</a><span>|</span><a href="javascript:void(0);"
										onclick="select(${exp3.address_id})" style="color: red">选择地址</a>
								</p>
							</div>
							<div class="addCon">
								<p>${exp3.address_name}</p>
								<p>${exp3.address_detail}</p>
								<p>${exp3.address_phone}</p>
							</div>
						</div>
					</c:forEach>
				</div>
				<h3>支付方式</h3>
				<!--------way---------------->
				<div class="way clearfix">
					<img class="on" src="o/img/temp/way01.jpg"> <img
						src="o/img/temp/way02.jpg"> <img src="o/img/temp/way03.jpg">
					<img src="o/img/temp/way04.jpg">
				</div>
				<h3>选择快递</h3>
				<!--------dis---------------->
				<div class="dis clearfix">
					<span class="on">顺风快递</span> <span>百世汇通</span> <span>圆通快递</span> <span>中通快递</span>
				</div>
			</div>
			<div class="orderR fr">
				<div class="msg">
					<h3>
						订单内容<a href="cart.do?c_id=${sessionScope.custom.c_id}" class="fr">返回购物车</a>
					</h3>
					<!--------ul---------------->
					<c:forEach items="${ordermessage}" var="exp1">
						<ul class="clearfix">
							<li class="fl"><img src="upimg/${exp1.dishPicture }"></li>
							<li class="fl">
								<p>${exp1.dishName}</p>
								<p>数量:${exp1.mnumber}</p>
							</li>
							<li class="fr">￥${exp1.dishPrice}</li>
						</ul>
					</c:forEach>
				</div>
				<!--------tips---------------->
				<c:forEach items="${order}" var="exp2">
					<div id="tips" class="tips" value="${exp2.oid}">
						<p>
							<span class="fl">商品金额：</span><span class="fr">￥${exp2.oamount}</span>
						</p>
						<p>
							<span class="fl">优惠金额：</span><span class="fr">￥0.00</span>
						</p>
						<p>
							<span class="fl">运费：</span><span class="fr">免运费</span>
						</p>
					</div>
					<!--------tips count---------------->
					<div class="count tips">
						<p>
							<span class="fl">合计：</span><span class="fr">￥${exp2.oamount}</span>
						</p>
					</div>
					<!--<input type="button" name="" value="去支付"> -->
					<a style="background-color: gray" href="javascript:void(0);"
					onclick="message(${Oid})" class="pay">写留言</a> <br />
					<a href="javascript:void(0);" onclick="checkout()" class="pay">去支付</a>
				</c:forEach>
			</div>
		</div>
	</div>
	<!--返回顶部-->
	<div class="gotop">
		<a href="cart.do?c_id=${sessionScope.custom.c_id}">
			<dl>
				<dt>
					<img src="o/img/gt1.png" />
				</dt>
				<dd>
					去购<br />物车
				</dd>
			</dl>
		</a> <a href="" class="dh">
			<dl>
				<dt>
					<img src="o/img/gt2.png" />
				</dt>
				<dd>
					联系<br />客服
				</dd>
			</dl>
		</a> <a href="">
			<dl>
				<dt>
					<img src="o/img/gt3.png" />
				</dt>
				<dd>
					个人<br />中心
				</dd>
			</dl>
		</a> <a href="" class="toptop" style="display: none;">
			<dl>
				<dt>
					<img src="o/img/gt4.png" />
				</dt>
				<dd>
					返回<br />顶部
				</dd>
			</dl>
		</a>
		<p>400-800-8200</p>
	</div>
	<!--footer-->
	<div class="footer">
		<div class="top">
			<div class="wrapper">
				<div class="clearfix">
					<a href="#2" class="fl"><img src="o/img/foot1.png" /></a> <span
						class="fl">7天无理由退货</span>
				</div>
				<div class="clearfix">
					<a href="#2" class="fl"><img src="o/img/foot2.png" /></a> <span
						class="fl">15天免费换货</span>
				</div>
				<div class="clearfix">
					<a href="#2" class="fl"><img src="o/img/foot3.png" /></a> <span
						class="fl">满599包邮</span>
				</div>
				<div class="clearfix">
					<a href="#2" class="fl"><img src="o/img/foot4.png" /></a> <span
						class="fl">手机特色服务</span>
				</div>
			</div>
		</div>
	</div>
	<script src="o/js/jquery-1.12.4.min.js" type="text/javascript"
		charset="utf-8"></script>
	<script src="o/js/public.js" type="text/javascript" charset="utf-8"></script>
	<script src="o/js/pro.js" type="text/javascript" charset="utf-8"></script>
	<script src="o/js/user.js" type="text/javascript" charset="utf-8"></script>
</body>
</html>
